package com.example.reference_book.filter.deptImpl;

import com.example.reference_book.entity.DeptInfo;
import com.example.reference_book.filter.DeptFilter;

import java.util.ArrayList;
import java.util.List;

public class DeptSchoolFilter implements DeptFilter {
    @Override
    public List<DeptInfo> getList(String key, List<DeptInfo> list) {
        List<DeptInfo> res = new ArrayList<>();
        System.out.println(key);
        for (DeptInfo item : list) {
            if (item.getSchoolName().contains(key)) {
                res.add(item);
            }
        }
        return res;
    }
}
